<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('title'); ?>
<?php echo "Edit Profile"; ?>
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
<div id="content" class="box">
	<h1><?php echo $name;?>'s Profile</h1>
		<?php if (isset($infos)) 
				{
					foreach ($infos as $info)
					{
		?>
				<p class="msg info"><?php echo $info;?></p>
		<?php		}
				}
		?>
		<fieldset>
			<legend>Edit Profile</legend>
		<?php if (isset($errors)) 
				{
					foreach ($errors as $error)
					{
		?>
				<p class="msg error"><?php echo $error;?></p>
		<?php		}
				}
		?>
		<form method="POST" action="<?php echo url('admin/profile');?>">
		<table class="nostyle">
			<tr>
				<td>Email:</td>
				<td><input type="text" class="input-text" name="email" value="<?php if (isset($email)) {echo $email;}?>"/></td>
			</tr>
			<tr>
				<td>Name:</td>
				<td><input type="text" class="input-text" name="name" value="<?php if (isset($name)) {echo $name;}?>"/></td>
			</tr>
			<tr>
				<td>Phone:</td>
				<td><input type="text" class="input-text" name="phone" value="<?php if (isset($phone)) {echo $phone;}?>"/></td>
			</tr>
			<tr>
				<td colspan="2" class="t-right"><input type="submit" class="input-submit" value="Save"/></td>
			</tr>
		</table>
		</form>
	</fieldset>
		<fieldset>
			<legend>Change Password</legend>
		<?php if (isset($passworderrors)) 
				{
					foreach ($passworderrors as $passworderror)
					{
		?>
				<p class="msg error"><?php echo $passworderror;?></p>
		<?php		}
				}
		?>
		<form method="POST" action="<?php echo url('admin/changepassword');?>">
		<table class="nostyle">
			<tr>
				<td>New Password:</td>
				<td><input type="password" class="input-text" name="password" value=""/></td>
			</tr>
			<tr>
				<td>Confirm New Password:</td>
				<td><input type="password" class="input-text" name="password2" value=""/></td>
			</tr>
			<tr>
				<td colspan="2" class="t-right"><input type="submit" class="input-submit" value="Save"/></td>
			</tr>
		</table>
		</form>
	</fieldset>
</div>
<?php $this->_endblock(); ?>
